package com.longdaji.decoration.ui.payFinish;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.longdaji.decoration.R;
import com.longdaji.decoration.base.BaseActivity;
import com.longdaji.decoration.ui.activitiesOfMine.allOrder.AllOrderActivity;
import com.longdaji.decoration.ui.main.MainActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by longtao on 2017/12/19.
 */

public class PayFinishActivity extends BaseActivity{

    private static final String TAG = PayFinishActivity.class.getSimpleName();

    @BindView(R.id.tv_title)
    TextView mTvTitle;
    @BindView(R.id.tv_pay_money)
    TextView mTvPayMoney;
    @BindView(R.id.btn_order)
    TextView mBtnOrder;
    @BindView(R.id.btn_home)
    TextView mBtnHome;
    private Intent intent;


    public static Intent getStartIntent(Context context) {
        Intent intent = new Intent(context, PayFinishActivity.class);
        return intent;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "PayOrderActivity onCreate");
        setContentView(R.layout.activity_pay_finish);
        setUnBinder(ButterKnife.bind(this));
        initView();
    }

    private void initView() {
        mTvTitle.setText("支付成功");
        if (getIntent() != null) {

            double money = getIntent().getDoubleExtra("money", 0);
            mTvPayMoney.setText("¥" + money);
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }


    @OnClick({R.id.iv_back, R.id.btn_order,R.id.btn_home})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_back:
                finish();
                break;
            case R.id.btn_order:
                intent =new Intent(this, AllOrderActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_home:
                intent = MainActivity.getStartIntent(PayFinishActivity.this);
                intent.putExtra("id", 1);
                startActivity(intent);
                break;
            default:
                break;
        }
    }


}
